<template>
	<view class="page">
		<!-- 头部背景图 -->
		<view class="pageTopImg" :style="'padding-top:' + touHeight + 'px'"></view>
		<!-- 顶部菜单 -->
		<view class="topHeader" :style="'height:' + touHeight +'px;'">
			<view class="fanhuiUp" @tap="toFanhuiUp"></view>
			<view class="pageTitle">酒店资料</view>
		</view>
		<view class="page_content" :style="'padding-top:' + touHeight + 'px'">
			<view class="danye_title">酒店全称</view>
			<view class="danye_text">{{name}}</view>
			<view class="danye_title">联系人</view>
			<view class="danye_text">{{contact}}</view>
			<view class="danye_title">联系手机</view>
			<view class="danye_text">{{phone}}</view>
			<view class="danye_title">营业执照</view>
			<view class="danye_text">
				<image :src="license_image_" mode="widthFix"></image>
			</view>
			<view class="danye_title">企业简介</view>
			<view class="danye_content">
				<jyf-parser :html="html"></jyf-parser>
			</view>
			<view class="fanhuiBtn" @tap="toFanhuiUp">返 回</view>
		</view>
	</view>
</template>

<script>
	import jyfParser from "@/components/jyf-parser/jyf-parser";
	const app = getApp()
	export default {
		components: {
		    jyfParser
		},
		data() {
			return {
				//域名拼接
				URL: app.globalData.URL,
				touHeight: 0,
				name:'',//酒店名称
				contact:'',//酒店联系人
				phone:'',//联系人电话
				license_image_:'',//酒店营业执照
				html: '',//酒店介绍内容
			}
		},
		onLoad(options){
			var that = this;
			//自定义头部高度
			app.customNav()
			that.touHeight = app.touHeight + 5//搜索栏距离顶部高度
			
			//酒店介绍内容
			uni.request({
				url: app.globalData.URL + '/api/v1/Hotel/real',
				method: "get",
				header:{
					token: uni.getStorageSync('token')
				},
				success:function(res){
					that.name = res.data.data.name//酒店名称
					that.contact = res.data.data.contact//酒店联系人
					that.phone = res.data.data.phone//联系人电话
					that.license_image_ = res.data.data.license_image_//酒店营业执照
					that.html = res.data.data.content//酒店介绍内容
				}
			})
		},
		methods: {
			//返回上一级
			toFanhuiUp:function(){
				uni.navigateBack({
				    delta: 1
				})
			},
		}
	}
</script>

<style>
	page{
		background: #fff;
	}
	.danye_title{
		font-size: 24rpx;
		color: #888888;
		padding-top: 30rpx;
	}
	.danye_content{
		font-size: 28rpx;
		color: #333333;
		line-height: 180%;
		margin-top: 20rpx;
	}
	.danye_content image{
		width: 100%;
		display: block;
	}
	.danye_text{
		font-weight: 900;
		font-size: 28rpx;
		color: #333333;
		margin-top: 15rpx;
	}
</style>
